<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加栏目</title>
</head>
<body>
    <form action="/web/update/{{ category.id }}/" method="post">
        {% csrf_token %}
        栏目名称: <input type="text" name="name" value="{{ category.name }}"> <br/>
        栏目类型: <select name="type">
                    {% if category.type is 0 %}
                        <option value="0" selected>导航栏目</option>
                    {% else %}
                        <option value="0">导航栏目</option>
                    {% endif %}
                    {% if category.type is 1 %}
                        <option value="1" selected>文章列表栏目</option>
                    {% else %}
                        <option value="1">文章列表栏目</option>
                    {% endif %}
                    {% if category.type is 2 %}
                        <option value="2" selected>文章内容栏目</option>
                    {% else %}
                        <option value="2">文章内容栏目</option>
                    {% endif %}
                    {% if category.type is 3 %}
                        <option value="3" selected>图片栏目</option>
                    {% else %}
                        <option value="3">图片栏目</option>
                    {% endif %}
                    {% if category.type is 4 %}
                        <option value="4" selected>超链接栏目</option>
                    {% else %}
                        <option value="4">超链接栏目</option>
                    {% endif %}
                </select> <br>
        栏目地址: <input type="text" name="href" value="{{ category.href }}"><br>
        是否是导航栏目:
            {% if category.is_nav %}
                 <input checked type="radio" name="is_nav" value="True">是
                 <input type="radio" name="is_nav" value="False">否 <br>
            {% else %}
                 <input type="radio" name="is_nav" value="True">是
                 <input checked type="radio" name="is_nav" value="False">否 <br>
            {% endif %}

        是否是首页新闻:
            {% if category.is_index %}
                <input checked type="radio" name="is_index" value="True">是
                <input type="radio" name="is_index" value="False">否 <br>
            {% else %}
                <input type="radio" name="is_index" value="True">是
                <input checked type="radio" name="is_index" value="False">否 <br>
            {% endif %}

        排序号: <input type="text" name="orders" value="{{ category.orders }}"> <br>
        <input type="submit" value="修改栏目">
    </form>
</body>
</html>